{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1412
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
   i,n,j,x:longint;
   a:array[0..110,0..110] of int64;
   f:boolean;
 
begin
assign(input,'input.txt');
assign(output,'output.txt');
reset(input);
rewrite(output);
read(x,n);
for i:=1 to n do
    for j:=1 to n do read(a[i][j]);
for i:=1 to n do begin
    f:=false;
    for j:=1 to n do
        if a[j][i]=x then begin
           f:=true;
           break;
        end;
    if f then writeln('YES') else writeln('NO');
end;
end.